package com.zhkj.txg.module.mine.ui

import android.app.Activity
import android.content.Intent
import android.view.View
import android.webkit.WebViewClient
import com.zhkj.lib.base.BaseActivity
import com.zhkj.txg.R
import kotlinx.android.synthetic.main.activity_balance_opration.*
import kotlinx.android.synthetic.main.activity_recharge.*

class RechargeActivity : BaseActivity() {


    companion object {


        private val TITLE = "title"
        private val HTTP = "http"

        // 充值
        fun openCZ(activity: Activity, title: String, http: String) {
            val intent = Intent(activity, RechargeActivity::class.java)
                .putExtra(TITLE,title)
                .putExtra(HTTP,http)
            activity.startActivity(intent)
        }
    }

    override val layoutResId: Int
        get() = R.layout.activity_recharge


    override fun statusTitleBar(): View? = titleRecharge

    override fun initUI() {

        titleRecharge.setTitleTextContent(intent.getStringExtra(TITLE))

        webView2.setWebViewClient(WebViewClient())
        webView2.getSettings().setDomStorageEnabled(true)
        webView2.getSettings().setDatabaseEnabled(true)
        webView2.getSettings().setJavaScriptEnabled(true)
//        val url = "https://www.txemart.com/api/article/recharge"
        val http = intent.getStringExtra(HTTP)
        webView2.loadUrl(http)
    }
}